//
//  DASegmentedControl.h
//  aa
//
//  Created by DreamArts on 16/4/6.
//  Copyright © 2016年 lidongyang. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum {
    DASegmentedControlTypeVertical = 0,  // 默认垂直
    DASegmentedControlTypeHorizontal,    // 水平
} DASegmentedControlType;

typedef enum {
    DASegmentedControlStyleDefault = 0    // 默认样式
} DASegmentedControlStyle;

typedef void(^TouchUpInsideBlocks)(NSInteger selectedIndex);

@interface DASegmentedControl : UIView

@property (nonatomic) DASegmentedControlType segmentedControlType;    // 样式
@property (nonatomic, setter = setStyle:) DASegmentedControlStyle segmentedControlStyle;  //类型
@property (nonatomic, copy) TouchUpInsideBlocks block;               // 用于点击回调的block
@property (nonatomic, setter = setDragEnabled:) BOOL dragEnabled;    // 是否允许拖拽

/*
 @override method initWithFrame
 @abstract 构造函数
 @discussion 通过frame参数构造DASegmentedControl
 @param frame 边框
 @result instancetype */
- (instancetype)initWithFrame:(CGRect)frame;

/*
 @method  setType
 @abstract type设置器
 @discussion 设置type类型
 @param style 枚举类型，默认DASegmentedControlType
 @result void
 */
- (void)setStyle:(DASegmentedControlStyle)style;

/*
 @method  addSegmentedControlInView:style:type:array:onTouchBlock:
 @abstract segmentedControl快速设方法
 @discussion 设置segmentedControl快速设置基本显示内容以及点击响应事件
 @param superView 添加的父View
 @param style 枚举类型 样式
 @param type 枚举类型 类型
 @param array 是用来显示的数组
 @param block 响应点击事件 
 @result void
 */
- (void)addSegmentedControlInView:(UIView *)superView style:(DASegmentedControlStyle)segmentedStyle type:(DASegmentedControlType)segmentedType array:(NSArray *)Array onTouchBlock:(TouchUpInsideBlocks)Block;

/*
 @method  setDragEnabled
 @abstract  拖拽
 @discussion  设置拖拽方法
 @param     dragEnabled 是否允许拖拽
 @result void
 */
- (void)setDragEnabled:(BOOL)dragEnabled;

@end
